﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WF_ProcessHandle_Process.aspx.vb"
    Inherits="MyWorkflow.WF_ProcessHandle_Process" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <link rel="stylesheet" type="text/css" href="/_common/styles/global.css">
    <script type="text/javascript" src="js/wf_chart_V2.js" ></script>
    <script language="javascript" src="Workflow_Mini.js"></script>
    <script language="javascript" src="js/wf_cancelBackSpace.js"></script>
	<%--BUG 45625 sunfx 2009年5月11日17:07:39 END--%>
    <script type="text/javascript">
        var bStepPreviewLoaded = false;
        function WF_Load()
        {   
            showDiv("Grid");            
        }
        function showDiv(mode){            
            var divGrid = $id("divGrid");
            var divChart = $id("divChart");
            var labRefurbish = $id("labRefurbish");
            var strHTML = "";
            switch(mode){
                case "Grid":                    
                    divGrid.style.display = "";
                    divChart.style.display = "none";
                    labRefurbish.style.display = "none";
                    break;
                case "Chart":
                    $id("rdChartMode").checked = true;
                    divGrid.style.display = "none";
                    WF_DrawGraph_Load();
                    WF_DrawGraph();
                    labRefurbish.style.display = enabledSave()?"":"none";
                    divChart.style.display = "block";
                    break;
            }
        }
        function enabledSave()
        {
            if (document.location.href.lastIndexOf("enabledSave=false")>-1)  return false;
            return true;
        }
        function getProcessModuleXML(processguid)
        {
	        var xml
	        xml = GetDataFromXMLHTTP("/MyWorkflow/WF_XMLHTTP.aspx","GetProcessEntityXML",processguid,"","");
            if (xml != -1) 
                return xml;
            else
                return "";
        }
        function saveGraph()
        {
	        var strxml;        	
	        
	        if ($id("txtProcessXml")!="")
	        {
	            WF_Save();
		        strxml = $id("txtProcessXml").value;
		        if (!saveGraphXYPos($id("txtProcessGUID").value , strxml)) 
		            alert("流程图步骤位置信息保存失败！");
		        else
		            alert("图形位置保存成功！");
	        }
        	
        }
        function saveGraphXYPos(processguid , strxml)
        {
	        var rtn;
	        rtn = GetDataFromXMLHTTP("/MyWorkflow/WF_XMLHTTP.aspx","SAVEGRAPHXYPOS",processguid,"",strxml);
        	
            if (rtn != -1) 
                return true;
            else
                return false;

        }
        function ReAssign(uids,names)
        {
            parent.ReAssign(uids,names);
            //
        }
    </script>
    <style>
        html,body {height:100%;}
        #tabStrip
        {
	        width: 100%;
	        height: 100%;
        }
        #tabStrip #divGrid
        {   
            padding: 5px;
            height: 100%;
            border: 1px #7d7d7d solid;
	        background-color: #FFF;
	        width: 100%;
        }
        #tabStrip #divChart
        {
            height: 100%;
            border: 1px #7d7d7d solid;
	        background-color: #FFF;
	        width: 100%;
        }
    </style>
</head>
<body bgcolor="efefeb" onload="WF_Load()">
    
    <form id="Form1" method="post" runat="server" style="display:none">
			<asp:TextBox ID="txtProcessGUID"  style="display:none" runat="server"></asp:TextBox>
			<asp:TextBox ID="txtProcessXml" style="display:none" runat="server"></asp:TextBox>
			<asp:TextBox ID="txtHandleXml" style="display:none" runat="server"></asp:TextBox>
    </form>
    
<div id="tabStrip"> 
    <table style="width:100%;height:100%">
        <tr valign="top" style="height:20px">
            <td>
                <input id="rdGridMode" name="rdMode" type="radio" checked onclick="showDiv('Grid')">表格展示
                <input id="rdChartMode" name="rdMode" type="radio" onclick="showDiv('Chart')">图形展示
            </td>
            <td align="right">
                <label id="labRefurbish" style="text-decoration: underline;padding-right:10px; cursor:pointer" onclick="saveGraph();">保存图形</label>
            </td>
        </tr>            
        <tr>
            <td colspan ="2" valign="top">
                   <div id="divGrid" runat="server" style="width:100%;height:100%;overflow-y:auto;SCROLLBAR-FACE-COLOR:#d4ddef;SCROLLBAR-HIGHLIGHT-COLOR:#d4ddef;SCROLLBAR-SHADOW-COLOR:#d4ddef;SCROLLBAR-3DLIGHT-COLOR:#d4ddef;SCROLLBAR-ARROW-COLOR:#3f6dad;SCROLLBAR-TRACK-COLOR:#f1f3f9;SCROLLBAR-DARKSHADOW-COLOR:#d4ddef;SCROLLBAR-BASE-COLOR:#000000;"></div>
                   <div id="divChart">
                        <iframe id="ifrChart" src="" width="100%" height="100%" frameborder="0"></iframe>
                   </div>
            </td>
        </tr>
    </table> 
</div>
</body>
</html>